package com.unswift.window.timer;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JLabel;

import com.unswift.QuickApplication;
import com.unswift.constant.QuickConstant;
import com.unswift.utils.StringUtils;

public class MemoryTimerTask implements ActionListener{

	@Override
	public void actionPerformed(ActionEvent e) {
		Runtime runtime = Runtime.getRuntime();
		JLabel memory=QuickApplication.cache.get(QuickConstant.CACHE_MEMORY_LABEL);
		memory.setText(
				"内存："+
				StringUtils.showCapacity(runtime.totalMemory()-runtime.freeMemory())+"/"+
				StringUtils.showCapacity(runtime.totalMemory())+"/"+
				StringUtils.showCapacity(runtime.maxMemory()));
	}

}
